package Java7_Concurrency_Cookbook.thread_executor_framework.completion_service;

import java.util.concurrent.CompletionService;

/**
 * @author lixiangke
 * @date 2017/11/20
 */
public class ReportRequest implements Runnable {
    private String name;

    private CompletionService<String> service;

    public ReportRequest(String name, CompletionService<String> service) {
        this.name = name;
        this.service = service;
    }

    @Override
    public void run() {
        ReportGenerator generator = new ReportGenerator(name, "Report");
        service.submit(generator);
    }
}
